package org.concepts.java.antlr.utils;

import org.antlr.runtime.Lexer;
import org.antlr.runtime.Token;

public class AntlrUtils {

  /**
   * Causes the lexer to process the input and print the tokens
   * @param lexer lexer. Should not be null.
   */
  public static void processAndPrintTokens(Lexer lexer) {
    Token token = lexer.nextToken();
    while (token.getText() != null) {
      System.out.println("Token " + token);
      token = lexer.nextToken();
    }
  }

}
